package com.cityfood.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cityfood.mapper.CfCompanyMapper;
import com.cityfood.pojo.CfCompany;
import com.cityfood.service.CompanyService;

@Service
public class CompanyServiceImpl implements CompanyService {
	
	@Autowired
	private CfCompanyMapper companyMapper;

	@Override
	public CfCompany getCompanyById(Integer companyId) {
		CfCompany company = companyMapper.selectByPrimaryKey(companyId);
		return company;
	}

	@Override
	public int insertCompany(CfCompany company) {
		int i = companyMapper.insertSelective(company);
		return i;
	}

	@Override
	public int updateCompany(CfCompany company) {
		int i = companyMapper.updateByPrimaryKeySelective(company);
		return i;
	}

	@Override
	public int deleteCompany(Integer companyId) {
		int i = companyMapper.deleteByPrimaryKey(companyId);
		return i;
	}

}
